package com.streamer.app.model

import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel

class MyViewModel : ViewModel()  {
    // 定义一个 LiveData，存放字符串
    private val _message = MutableLiveData<String>()
        val message: LiveData<String> get() = _message

    // 更新数据的方法
    fun updateMessage(newMsg: String) {
        _message.value = newMsg
    }



    private val _message2 = MutableLiveData<String>()
    val message2: LiveData<String> get() = _message2

    // 更新数据的方法
    fun updateMessage2(newMsg: String) {
        _message2.value = newMsg
    }
}